package com.yanqu.road.server.cmd.activity.summerquiz;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.SummerQuizProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.summerquiz.CrossSummerQuizActivity;
import com.yanqu.road.server.manager.activity.summerquiz.CrossSummerQuizMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_SUMMER_QUIZ_GUESS_GET_USER_REWARD, desc = "结算领取竞猜奖励")
public class CrossSummerQuizGuessGetRewardCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        SummerQuizProto.CrossSummerQuizGuessGetRewardReqMsg reqMsg = SummerQuizProto.CrossSummerQuizGuessGetRewardReqMsg.parseFrom(packet.getBytes());

        CrossSummerQuizActivity activity = CrossSummerQuizMgr.getActivity(reqMsg.getActivityId());
        if(activity != null){
            activity.getGuessReward(serverId, packet.getPlayerId(), reqMsg.getGameActivityId(), reqMsg.getQuizId(), reqMsg.getScoreGoodsId());
        }
    }

    @Override
    public void sendData() {

    }
}
